Conversation
|
Thanks, so much, @Franzi2114. If nobody else can get to this, I can review it some time over the next week. |
|
Perfec,t thanks @bob-carpenter! I was also in contact with @WardBrian before I did the PR. There are still three open points that I didn't manage to incorporate:
Please let me know when there occur more points that I should change. |
|
Hi @Franzi2114 -- I've just pushed a commit that addresses each of your comments, since they're mostly quarto-wrangling:
|
|
Pinging @bob-carpenter again -- I think the notifications for this got lost while you were away |
|
Thanks for pinging. I will review this week. |
bob-carpenter
left a comment
There was a problem hiding this comment.
Hi, Franzi:
I'm really sorry this is so many comments. Most of it's to try to get consistency with the rest of our documentation's formatting.
The most important comment is about the upper bounds for parameters that are missing from the examples.
If you'd rather not make the fixes yourself, I think I can go through and make almost all of them other than places where I had genuine questions.
|
|
||
| @article{Henrich2026, | ||
| author={Henrich, Franziska and Klauer, Karl Christoph}, | ||
| title={Modeling truncated and censored data with the diffusion model in Stan}, |
There was a problem hiding this comment.
Capitals in titles need to be escaped, so
Stan -> {S}tan
in the title.
| @article{Wagenmakers2009, | ||
| author = {Wagenmakers, Eric-Jan}, | ||
| year = {2009}, | ||
| title = {{Methodological and empirical developments for the Ratcliff diffusion model of response times and accuracy}}, |
There was a problem hiding this comment.
Only escape the unusual caps, so that BibTeX can style. This should not have the outer braces and just curly braces around the R in Ratcliff.
| volume = {21}, | ||
| number = {5}, | ||
| issn = {0954-1446}, | ||
| journal = {{European Journal of Cognitive Psychology}}, |
There was a problem hiding this comment.
No double braces. BibTeX styles sort out which style of capitalization and we only need to provide hints about things that should always be capitalized by wrapping in curly braces.
| @article{Ulrich1994, | ||
| author = {Ulrich, Rolf and Miller, Jeff}, | ||
| year = {1994}, | ||
| title = {{Effects of truncation on reaction time analysis}}, |
| pages = {34--80}, | ||
| volume = {123}, | ||
| number = {1}, | ||
| journal = {{Journal of Experimental Psychology: General}} |
| Censoring sometimes includes the response (i.e., it is known that the reaction time in a trial fell outside the response window, but which response was given is unknown). One method that has been used to model such data has involved inferring the numbers of missing responses of either kind from the observed relative frequencies of the two responses. This approach has the problem that quite specifc assumptions on the missing data have to be made (namely, that the proportions of the two kinds of responses are the same for responses within and outside the response window). | ||
|
|
||
| Here is a more principled approach that uses the cumulative distribution functions and their complements to provide the likelihood of censored data. As before, let $L$ be the left reaction time bound, and $U$ the right reaction time bound, and consider decision times without inter-trial variabilities for the sake of simplicity. It follows that the likelihood $p_l$ of observing a left-censored data point | ||
| is given by |
There was a problem hiding this comment.
This isn't quite the right usage of "likelihood". See:
https://statmodeling.stat.columbia.edu/2026/03/20/a-data-model-is-not-just-a-likelihood/
If we have a data-generating distribution
Specifically, this means we can't say "likelihood of data" as the likelihood function, in order to exist, has already fixed the data.
This is confused in the literature all over the place, but BDA makes it clear, as does Aki's post.
|
|
||
|
|
||
| See the following code for an example of Stan code implementing this second case of censoring. This model call deals with the problem of unknown responses by computing the probability of choosing the response-1- or response-0 boundary outside the response window. Here, the CDF and/or the CCDF are required, depending upon whether there is only left-censoring, right-censoring, or censoring both to the left and to the right. The following code shows the **functions block** for a model that is right-censored using the function `partial_sum_wiener()` for parallel computations. Combine this block with the **model block** in the example above: | ||
|
|
There was a problem hiding this comment.
he block doesn't actually show any parallel computations, so either get rid of this or say a bit more about what would be required.
| See the following code for an example of Stan code implementing this second case of censoring. This model call deals with the problem of unknown responses by computing the probability of choosing the response-1- or response-0 boundary outside the response window. Here, the CDF and/or the CCDF are required, depending upon whether there is only left-censoring, right-censoring, or censoring both to the left and to the right. The following code shows the **functions block** for a model that is right-censored using the function `partial_sum_wiener()` for parallel computations. Combine this block with the **model block** in the example above: | ||
|
|
||
| ```stan | ||
| functions { // parallelization function |
There was a problem hiding this comment.
It's not clear what "parallelization function" refers to here---whatever it is, it shouldn't be a comment on the functions block.
I take it you mean that the partial_sum_wiener function could be used in reduce_sum? If so, it would help to say so somewhere.
| ```stan | ||
| functions { // parallelization function | ||
| real partial_sum_wiener(array[] real rt_slice, int start, | ||
| int end, real a, real t0, real w, real v, real sv, real sw, |
There was a problem hiding this comment.
indent the second and third line of arguments under the first arguments.
two spaces indent everywhere
| return ans; | ||
| } // end partial_sum_fullddm | ||
| } // end functions | ||
| ``` |
There was a problem hiding this comment.
Like the earlier functions, a transformed data block that sorted the three types of data would allow vectorization and allow the censoring parts to be replaced. with a product given that the right bound doesn't change.
Summary
This PR adds a user's guide entry for the wiener diffusion model. It is linked to the PRs for the seven parameter diffusion model PDF and CDF functions
stan-dev/math#2822
stan-dev/math#3042
Copyright and Licensing
Please list the copyright holder for the work you are submitting (this will be you or your assignee, such as a university or company):
Franziska Henrich
By submitting this pull request, the copyright holder is agreeing to license the submitted work under the following licenses: